package com.cn.type;

import org.apache.commons.lang.math.NumberUtils;

/**
 * Short类型
 * @author sushy
 * @date 2016-3-23 
 */
public class TypeShort implements ITypeConverter {
	private static Short ZERO = Integer.valueOf(0).shortValue();

	public Object getValue(String text) {
		if (text == null) {
			return ZERO;
		}
		return NumberUtils.toShort(text);
	}

	public String getText(Object value) {
		if (value == null) {
			return null;
		}
		return value.toString();
	}

}
